package com.bed.lovewithpatientbed.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * maintain
 * @author 
 */
public class Maintain implements Serializable {
    private Integer maintainId;

    private Integer malfunctionId;

    private Integer bedId;

    private Integer malfunctionTypeId;

    private Integer bedStatusId;

    private String maintainInfor;

    private Integer employeeId;

    private Integer maintainState;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date maintainDate;

    private Integer softdel;

    private Malfunction malfunction;


    public Malfunction getMalfunction() {
        return malfunction;
    }

    public void setMalfunction(Malfunction malfunction) {
        this.malfunction = malfunction;
    }

    private static final long serialVersionUID = 1L;

    public Integer getMaintainId() {
        return maintainId;
    }

    public void setMaintainId(Integer maintainId) {
        this.maintainId = maintainId;
    }

    public Integer getMalfunctionId() {
        return malfunctionId;
    }

    public void setMalfunctionId(Integer malfunctionId) {
        this.malfunctionId = malfunctionId;
    }

    public Integer getBedId() {
        return bedId;
    }

    public void setBedId(Integer bedId) {
        this.bedId = bedId;
    }

    public Integer getMalfunctionTypeId() {
        return malfunctionTypeId;
    }

    public void setMalfunctionTypeId(Integer malfunctionTypeId) {
        this.malfunctionTypeId = malfunctionTypeId;
    }

    public Integer getBedStatusId() {
        return bedStatusId;
    }

    public void setBedStatusId(Integer bedStatusId) {
        this.bedStatusId = bedStatusId;
    }

    public String getMaintainInfor() {
        return maintainInfor;
    }

    public void setMaintainInfor(String maintainInfor) {
        this.maintainInfor = maintainInfor;
    }

    public Integer getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(Integer employeeId) {
        this.employeeId = employeeId;
    }

    public Integer getMaintainState() {
        return maintainState;
    }

    public void setMaintainState(Integer maintainState) {
        this.maintainState = maintainState;
    }

    public Date getMaintainDate() {
        return maintainDate;
    }

    public void setMaintainDate(Date maintainDate) {
        this.maintainDate = maintainDate;
    }

    public Integer getSoftdel() {
        return softdel;
    }

    public void setSoftdel(Integer softdel) {
        this.softdel = softdel;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Maintain other = (Maintain) that;
        return (this.getMaintainId() == null ? other.getMaintainId() == null : this.getMaintainId().equals(other.getMaintainId()))
            && (this.getMalfunctionId() == null ? other.getMalfunctionId() == null : this.getMalfunctionId().equals(other.getMalfunctionId()))
            && (this.getBedId() == null ? other.getBedId() == null : this.getBedId().equals(other.getBedId()))
            && (this.getMalfunctionTypeId() == null ? other.getMalfunctionTypeId() == null : this.getMalfunctionTypeId().equals(other.getMalfunctionTypeId()))
            && (this.getBedStatusId() == null ? other.getBedStatusId() == null : this.getBedStatusId().equals(other.getBedStatusId()))
            && (this.getMaintainInfor() == null ? other.getMaintainInfor() == null : this.getMaintainInfor().equals(other.getMaintainInfor()))
            && (this.getEmployeeId() == null ? other.getEmployeeId() == null : this.getEmployeeId().equals(other.getEmployeeId()))
            && (this.getMaintainState() == null ? other.getMaintainState() == null : this.getMaintainState().equals(other.getMaintainState()))
            && (this.getMaintainDate() == null ? other.getMaintainDate() == null : this.getMaintainDate().equals(other.getMaintainDate()))
            && (this.getSoftdel() == null ? other.getSoftdel() == null : this.getSoftdel().equals(other.getSoftdel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMaintainId() == null) ? 0 : getMaintainId().hashCode());
        result = prime * result + ((getMalfunctionId() == null) ? 0 : getMalfunctionId().hashCode());
        result = prime * result + ((getBedId() == null) ? 0 : getBedId().hashCode());
        result = prime * result + ((getMalfunctionTypeId() == null) ? 0 : getMalfunctionTypeId().hashCode());
        result = prime * result + ((getBedStatusId() == null) ? 0 : getBedStatusId().hashCode());
        result = prime * result + ((getMaintainInfor() == null) ? 0 : getMaintainInfor().hashCode());
        result = prime * result + ((getEmployeeId() == null) ? 0 : getEmployeeId().hashCode());
        result = prime * result + ((getMaintainState() == null) ? 0 : getMaintainState().hashCode());
        result = prime * result + ((getMaintainDate() == null) ? 0 : getMaintainDate().hashCode());
        result = prime * result + ((getSoftdel() == null) ? 0 : getSoftdel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", maintainId=").append(maintainId);
        sb.append(", malfunctionId=").append(malfunctionId);
        sb.append(", bedId=").append(bedId);
        sb.append(", malfunctionTypeId=").append(malfunctionTypeId);
        sb.append(", bedStatusId=").append(bedStatusId);
        sb.append(", maintainInfor=").append(maintainInfor);
        sb.append(", employeeId=").append(employeeId);
        sb.append(", maintainState=").append(maintainState);
        sb.append(", maintainDate=").append(maintainDate);
        sb.append(", softdel=").append(softdel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}